/**
 * 
 */
package org.cuatrovientos.dungeon;

import java.util.Random;

/**
 * Represent a Dice
 * @author David
 *
 */
public class Dice {
	private int sides;
	private boolean enableZero;
	
	/**
	 * Create a Dice
	 * @param sides
	 * @param enableZero
	 */
	public Dice(int sides, boolean enableZero) {
		this.sides = sides;
		this.enableZero = enableZero;
	}
	/**
	 * Roll the dice
	 * @return
	 */
	public int LaunchDice(){
		Random rand = new Random();
		if (enableZero) {
			return rand.nextInt(sides);
		}
		return rand.nextInt(sides)+1;
	}
}
